package com.crm.service.impl;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.dao.StudetnDao;
import com.crm.entity.Asker;
import com.crm.entity.Student;
import com.crm.service.StudentService;
//学生服务层实现类
@Service
public class StudentServiceImpl implements StudentService{
	@Autowired
	private StudetnDao studetnDao;//自动注入
	@Override
	public Integer add(Student student) {
		// TODO Auto-generated method stub
		return studetnDao.add(student);
	}
	@Override
	public List<Map<String, Object>> getAllStudetnNet(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return studetnDao.getAllStudetnNet(map);
	}
	@Override
	public Integer getAllStudetnNetCount(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return studetnDao.getAllStudetnNetCount(map);
	}
	@Override
	public List<Map<String, Object>> getAllStudent(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return studetnDao.getAllStudent(map);
	}
	@Override
	public Integer getAllStudentCount(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return studetnDao.getAllStudentCount(map);
	}
	@Override
	public Integer getLoginName(String loginName) {
		// TODO Auto-generated method stub
		return studetnDao.getLoginName(loginName);
	}
	@Override
	public Integer updateisDel(Student student) {
		// TODO Auto-generated method stub
		return studetnDao.updateisDel(student);
	}
	@Override
	public Integer update(Student student) {
		// TODO Auto-generated method stub
		return studetnDao.update(student);
	}
	@Override
	public List<Map<String, Object>> getAllStudetnNetExcel(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return studetnDao.getAllStudetnNetExcel(map);
	}
	@Override
	public List<Map<String, Object>> getAllStudentExcel(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return studetnDao.getAllStudentExcel(map);
	}
	@Override
	public Integer updateisAskerId(Student student) {
		// TODO Auto-generated method stub
		return studetnDao.updateisAskerId(student);
	}
	@Override
	public List<Asker> getAsker(Asker asker) {
		// TODO Auto-generated method stub
		SimpleDateFormat dff = new SimpleDateFormat("yyyy-MM-dd");// 设置日期格式
		asker.setCheckInTime(dff.format(new Date()));
		return studetnDao.getAsker(asker);
	}
	@Override
	public Integer selectAsker(int id) {
		// TODO Auto-generated method stub
		return studetnDao.selectAsker(id);
	}

}
